using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class QuestRequireText : MonoBehaviour
{
    /// <summary>
    /// 任务需求的物品或敌怪名称：大蘑菇
    /// </summary>
    private Text requireName;
    /// <summary>
    /// 任务需求的数量：0/3
    /// </summary>
    private Text requireAmount;
    private void Awake()
    {
        requireName = GetComponent<Text>();
        requireAmount = transform.GetChild(0).GetComponent<Text>();
    }
    public void Setup(QuestData_SO.QuestRequire require)
    {
        requireName.text = require.name;
        requireAmount.text = require.currentAmount.ToString() + "/" + require.requireAmount.ToString();
    }
    /// <summary>
    /// 任务需求完成交付时的文本
    /// </summary>
    /// <param name="requireItemName"></param>
    public void Setup(string requireItemName)
    {

        requireName.text = requireItemName;
        requireName.color = Color.gray;
        requireAmount.text = "完成";
        requireAmount.color = Color.gray;

    }
}
